using System.Collections.Generic;
using OneDayModel.Interfaces;

namespace OneDayModel.Model
{
    internal class RoleAttributeEnumerator : IEnumerator<IRoleAttribute>
    {
        private readonly IEnumerator<RawRoleAttribute> enumerator;

        public RoleAttributeEnumerator(IEnumerator<RawRoleAttribute> enumerator)
        {
            this.enumerator = enumerator;
        }

        IRoleAttribute IEnumerator<IRoleAttribute>.Current
        {
            get { return GetCurrent(); }
        }

        private IRoleAttribute GetCurrent()
        {
            return new IRoleAttribute(enumerator.Current);
        }

        public void Dispose()
        {
            enumerator.Dispose();
        }

        public bool MoveNext()
        {
            return enumerator.MoveNext();
        }

        public void Reset()
        {
            enumerator.Reset();
        }

        public object Current
        {
            get { return GetCurrent(); }
        }
    }
}